package mobi.yuanshen.common.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import mobi.yuanshen.common.domain.dto.PicCodeDTO;
import mobi.yuanshen.common.service.CommonService;
import mobi.yuanshen.common.utils.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@Slf4j
@RestController
@Tag(name = "通用接口")
@RequiredArgsConstructor
@RequestMapping("/common")
public class CommonController {

    private final CommonService commonService;

    @GetMapping("/getPicCode")
    @Operation(summary = "获取图片验证码")
    public Result<PicCodeDTO> getPicCode () {
        PicCodeDTO picCode =  commonService.getPicCode();
        return Result.success(200, "获取图片验证码成功", picCode);
    }
}
